package edu.sctu.jsoup.service;

import edu.sctu.jsoup.entity.StudentEntity;
import edu.sctu.jsoup.repo.StudentRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentService {

    @Autowired
    private StudentRepo studentRepo;


    public void  run(){

//        studentRepo.findOne(10L);
//        studentRepo.findByName("yijia");
//        studentRepo.findByAge(19);


        StudentEntity chen = new StudentEntity();
        chen.setName("chen");
        chen.setAge(30);

        StudentEntity yi = new StudentEntity();
        chen.setName("yijia");
        chen.setAge(18);

        studentRepo.save(chen);
        studentRepo.save(yi);
    }
}
